<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>百度</title>
    <script src="../lib/jquery-1.11.1.min.js"></script>
    <style>
        ul li{
            list-style: none;
            display: inline-block;
            width: 200px;
            height: 40px;
            line-height: 40px;
        }
        #text{
            width: 200px;
        }
    </style>
    <script>


        $(function () {
            $("#key").on("keyup",function () {


                $.getJSON("https://sp0.baidu.com/5a1Fazu8AA54nxGko9WTAnF6hhy/su?cb=?",{"wd":this.value},function (ele) {

                    $("#text ").empty();
                    for(var i=0;i<ele.s.length; i++)
                    {
                        $("<li>" + ele.s[i] + "</li>").appendTo($("#text "))
                    }
                    $("#text").find("li").click(function () {

//                        $("#key").valueOf()
                        $("#key").attr("value",$(this).text())
                    })

                })


            })


        })
    </script>
</head>
<body>
<input id="key">
<button id="btn">百度一下</button>
<div id="text">

</div>


</body>
</html>